/*
 * @Author: gaojinyu 1593026814@qq.com
 * @Date: 2023-12-04 15:32:15
 * @LastEditors: gaojinyu 1593026814@qq.com
 * @LastEditTime: 2024-01-03 13:43:03
 * @FilePath: \test\vue.config.js
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    open: true,
    proxy: {
      "/sid": {
        // target: "https://dev-insetapi.metasmartedu.cn/",
        target: "https://insetapi.metasmartedu.cn",
        changeOrigin: true,
        pathRewrite: {
          "^/sid": "",
        },
      },
    },
  },
  chainWebpack: (config) => {
    const oneOfsMap = config.module.rule("scss").oneOfs.store;
    oneOfsMap.forEach((item) => {
      item
        .use("sass-resources-loader")
        .loader("sass-resources-loader")
        .options({
          // 全局变量文件路径，只有一个时可将数组省去
          resources: ["./src/assets/scss/base.scss"],
        })
        .end();
    });
  },
  configureWebpack: {
    plugins: [
      // require("unplugin-vue-setup-extend-plus/webpack").default({
      //   enableAutoExpose: true,
      // }),
      require("unplugin-vue-define-options/webpack")(),
    ],
  },
});
